package edu.zhku;

import java.io.FileOutputStream;
import java.io.OutputStreamWriter;

public class IO_Write {

	public static void main(String[] args)
	{
		FileOutputStream fos = null;
		OutputStreamWriter osw = null;
		try {
			fos = new FileOutputStream("F:\\test.txt",true);
			osw = new OutputStreamWriter(fos);
			
			osw.write("林少基");
			osw.flush();
			}
		catch (Exception e) {e.printStackTrace();}
		finally
		{
			try {osw.close();} 
			catch (Exception e){e.printStackTrace();}
			try {fos.close();} 
			catch (Exception e){e.printStackTrace();}
			
			System.out.println("数据已经成功写入！！！");
		}
	}
}
